
var fakeDiv = document.createElement("div");

var iconBounce = function(icon)
{
    prefsApp();
};

var iconDyn = function()
{
	//alert("???");
};

var BView = function(frame,name,resizingMode,flags)
{
	this.myView = new BDirectView(frame,name,resizingMode,0);
	this.frame = frame;
	this.name = name;
	this.resizingMode = resizingMode;
	this.flags = flags;

	this.Draw = function()
	{
		
		
	};
	
	this.KeyDown = function()
	{
		
	};

	this.KeyUp = function()
	{
		
	};

	this.Pulse = function()
	{
		alert("ping");
	};
	
	this.LockLooper = function()
	{
	};
	
	this.UnlockLooper = function()
	{
	};	
};


var BBox = function ()
{
	this.myView = new BView(frame,name,mode,0);	
		
};

var BControl = function()
{
	this.myView = new BView(frame,name,mode,0);	
};

var BScrollView = function()
{
	this.myView = new BView(frame,name,mode,0);
};

var BScrollBarView = function()
{
	this.myView = new BView(frame,name,mode,0);
};

var BCheckBox = function()
{
	this.myView = new BView(frame,name,mode,0);
};

var BButton = function(frame,name,label,message,mode)
{
	this.myView = new BView(frame,name,mode,0);

	this.onKeyDown = function()
	{
		
	};
	
	this.onKeyUp = function()
	{
		
	};
	
};

var BColorControl = function()
{
		this.myView = new BView(frame,name,mode,0);
};

var BMenu = function()
{
		this.myView = new BView(frame,name,mode,0);
};

var BIcon = function(x,y,name,path,callback)
{
    this.myDiv;
    this.myPath = path;
    this.myName = name;
    this.myCallback = callback;
	this.x = x;
	this.y = y;
	
    this.Attach = function(view)
    {
        this.myDiv = document.createElement("div");
        this.myDiv.innerHTML = "<div onclick=\""+this.myCallback+"\"   ><img src=\""+path + "\" width=\"50px\"> </div>"+name+"</div>";
        this.myDiv.style.position = "absolute"; 
        this.myDiv.style.overflow = "hidden";   
        this.myDiv.style.left = this.x;
        this.myDiv.style.top = this.y;
        this.myDiv.style.width = 53;
        this.myDiv.style.font = 6;
        this.myDiv.style.height = 65;    
        this.myDiv.style.color = "white";
                      
        view.appendChild(this.myDiv);
    };
    
    this.Action = function(myCallback)
    {
        this.myCallback = myCallback;
    };
};


MenuItem = function(name,callback)
{
	
	
};

ToolBar = function(frame,name)
{
	this.x = frame.x;
	this.y = frame.y;
	this.width = frame.width;
	this.height = frame.height;
	this.name = name;
	this.window = new BDirectWindow(frame,name,"","TRAY_VIEW",0);
	this.window.Show();	
};


